www.gusucode.com > PLL Frequency Synthesis Examples 程序工具箱matlab源码 > PLL Frequency Synthesis Examples/pll_design_cp_v2/CL_Bode_Plot.m

    %% Closed Loop Bode Plot Script

Fvec=CL_TF(:,2);     % Note the order is reversed from the Double Cross estimator. 
Xfer = CL_TF(:,1);
dB = 20*log10(abs(Xfer));
phase = (180/pi)*atan2(imag(Xfer),real(Xfer));

subplot(2,1,1); semilogx(Fvec,dB); 
title('Magnitude'); xlabel('Hz');ylabel('dB'); grid on;
axis([0 Fvec(end) -25 25])
subplot(2,1,2); semilogx(Fvec,phase); 
title('Phase');xlabel('Hz');ylabel('Degrees'); grid on;
set(gcf,'Name','Closed Loop PLL Transfer Function Measurement','NumberTitle','off');